/*******************************************************************************
 * Copyright (c) 2012 AwOiSoAk.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v3.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Contributors:
 *     $AwOiSoAk - initial API and implementation
 ******************************************************************************/
package com.awoisoak.dundeeguide;


import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Nightlifes extends Activity implements OnItemClickListener {
	
	private String[] stringNightlifes;
	private ListView listViewNightlifes;
	private ArrayAdapter<String> aa;
	
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.nightlifes);
		
		stringNightlifes= new String[] {"Fat Sam's","DUSA The Union","Reading Rooms","Liquid and Envy",
										 "Beat Generator Live!","The Doghouse"};
		listViewNightlifes = (ListView)findViewById(R.id.listViewNightlifes);
		aa = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,stringNightlifes);
		listViewNightlifes.setAdapter(aa);
		listViewNightlifes.setOnItemClickListener(this);
		

}

	@Override
	public void onItemClick(AdapterView<?> av, View v, int position, long arg3) {
		String item = stringNightlifes[position].toString();
		Intent i;
		String coord= null;
		String website = null;
		int explanation=0;
		int iconPlace=0;
		
			if (item=="Fat Sam's"){
				coord="56.460588,-2.977028";
				website="https://m.facebook.com/FatSams?v=feed";  
				explanation=R.string.Fat_Sams;
				iconPlace=R.drawable.ic_fatsams;}

			else if (item=="DUSA The Union"){
				coord="56.457879,-2.982356";
				website="https://m.facebook.com/DUSA.TheUnion?v=feed";
				explanation=R.string.Union;
				iconPlace=R.drawable.ic_union;}
			
			else if (item=="Reading Rooms"){
				coord="56.464969,-2.961711";
				website="https://www.facebook.com/ReadingRooms";
				explanation=R.string.Reading_Rooms;
				iconPlace=R.drawable.ic_readingrooms;}
			
			else if (item=="Liquid and Envy"){
				coord="56.460514,-2.976719";
				website="https://www.facebook.com/DundeeLiquidEnvy/wall";
				explanation=R.string.Liquid_And_Envy;
				iconPlace=R.drawable.ic_liquid;}
			
			else if (item=="Beat Generator Live!"){
				coord="56.460887,-2.976112";
				website="http://www.facebook.com/pages/Beat-Generator/185656164752";
				explanation=R.string.Beat_Generator;
				iconPlace=R.drawable.ic_beatgenerator;}

			else if (item=="The Doghouse"){
				coord="56.460992,-2.966922";
				website="http://m.facebook.com/dundeedoghouse?v=feed";
				explanation=R.string.Doghouse;
				iconPlace=R.drawable.ic_doghouse;}


		i = new Intent(Nightlifes.this,Nightlife.class);  
		i.putExtra("tag_coordinate", coord);
		i.putExtra("tag_place", item);
		i.putExtra("tag_explanation", explanation);
		i.putExtra("tag_icon", iconPlace);
		i.putExtra("tag_website", website);
		startActivity(i);
			
			
		
	}
}
